package com.hopu.v1.pojo.exam;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopu.v1.pojo.common.Delete;
import com.hopu.v1.pojo.common.Save;
import com.hopu.v1.pojo.common.Update;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 考试选项答案表
 * @TableName t_exam_option_answer
 */
@TableName(value ="t_exam_option_answer")
@Data
public class ExamOptionAnswer implements Serializable {
    /**
     * 选项唯一标识
     */
    @NotNull(message = "id不能为空", groups = {Delete.class, Update.class})
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 考试题目唯一标识
     */
    @NotNull(message = "考试题目不能为空", groups = {Save.class, Update.class})
    private Integer questionId;

    /**
     * 选项/参考答案
     */
    @NotBlank(message = "选项不能为空",groups = {Save.class, Update.class})
    private String optionText;

    /**
     * 是否是正确答案
     */
    @NotNull(message = "是否是正确答案不能为空", groups = {Save.class, Update.class})
    private Integer isCorrect;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}